@include('header')
@if(!$data)
	@include('empty_data')
@else
<link rel="stylesheet" href="{{asset('css/messages.css')}}" />
<div class="wrapper">
	@foreach($data as $k=>$v)
	<div class="messageItem system-messages">
		<a @if($v->name == '投诉回复' || $v->name == '投诉消息') onclick="native()" @else href="{{url('webview/messages_list?type_id='.$v->id.'&uid='.request('uid'))}}" @endif class="linkMessage">
			<div class="icon" style="background-image:url({{$v->image}})"></div>
			<div class="message-r">
				<div class="messageTop">
					<div class="messageType">
						<div class="messageType-tile">
							{{$v->name}}
						</div>
						@if($v->unview_count > 0)
							<span class="status unread">未读</span>
						@else
							<span class="status read">已读</span>
						@endif
					</div>
					<div class="messageTime">{{$v->preview_time}}</div>
				</div>
				<div class="messageInner">
					<div class="messageDesc">
						{{$v->preview or '暂无消息'}}
					</div>
					@if($v->unview_count > 0)<i class="red-dot">{{$v->unview_count}}</i>@endif
				</div>
			</div>
		</a>
	</div>
	@endforeach
</div>
@endif

<script>
	function native(){
		try{
			complaintReplyClick();
		}catch(e){
			window.Android.complaintReplyClick();
		}
	}

</script>